/*
 * DisclaimerPanel.java
 *
 * The initial GUI ensuring the user has read and agreed to any terms.
 *
 * @author Michael Drayson
 * @version 1.0
 */

package drayson.weboca.gui;

import org.netbeans.spi.wizard.WizardPage;
import java.awt.Component;

public class DisclaimerPanel extends WizardPage {
    
    /**
     * Creates new form DisclaimerPanel using the Wizard framework
     */
    public DisclaimerPanel() {
        super("Disclaimer", "Disclaimer");         // Passes parameters to the super class
        initComponents();                          // Initialises all components on the page
    }
    
    /**
     * Returns the description of this GUI form
     *
     * @return The description of this form
     */
    public static String getDescription() {
        
        return "Disclaimer";
    }

    /**
     * Validates the JTextBox confirmBox to ensure that the user has agreed to the disclaimer
     *
     * @param component The component
     * @param o The object
     * @return The error presented by the Wizard framework if the condition isn't met
     */
    protected String validateContents (Component component, Object o) {
    
        if (!confirmBox.isSelected()) {
            return "Please read the above and tick to confirm.";
        }
        
        return null;
    }
    
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        grpBuildType = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        confirmBox = new javax.swing.JCheckBox();
        jLabel5 = new javax.swing.JLabel();

        jLabel1.setText("This software is currently in an early stage, and you can ");
        jLabel1.setMaximumSize(new java.awt.Dimension(32767, 32767));

        jLabel2.setText("expect to find lots of issues and other problems in it.");
        jLabel2.setMaximumSize(new java.awt.Dimension(32767, 32767));

        jLabel3.setText("If you insist upon contacting me, I can be reached at the following address:");

        jLabel4.setText("scs4mpd@comp.leeds.ac.uk");

        confirmBox.setText("Please tick here to confirm you agree to these terms");
        confirmBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        confirmBox.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jLabel5.setText("Currently, all rights are reserved.");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(confirmBox)
                    .add(jLabel3)
                    .add(jLabel4)
                    .add(jLabel5))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(58, 58, 58)
                .add(jLabel3)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel4)
                .add(60, 60, 60)
                .add(jLabel5)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 63, Short.MAX_VALUE)
                .add(confirmBox)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox confirmBox;
    private javax.swing.ButtonGroup grpBuildType;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    // End of variables declaration//GEN-END:variables
    
}
